package com.kgc.sbt.mapper;

import com.kgc.sbt.beans.ShoppingCart;
import com.kgc.sbt.beans.ShoppingCartExample;

import java.util.List;

import com.kgc.sbt.beans.ShoppingCartForm;
import org.apache.ibatis.annotations.Param;

public interface ShoppingCartMapper {
    long countByExample(ShoppingCartExample example);

    int deleteByExample(ShoppingCartExample example);

    int deleteByPrimaryKey(Integer carId);

    int deleteByUserId(Integer userId);

    int deleteByProductId(Integer userId, Integer productId);

    int insert(ShoppingCart record);

    int insertSelective(ShoppingCart record);

    List<ShoppingCart> selectByExample(ShoppingCartExample example);

    ShoppingCart selectByPrimaryKey(Integer carId);

    int updateByExampleSelective(@Param("record") ShoppingCart record, @Param("example") ShoppingCartExample example);

    int updateByExample(@Param("record") ShoppingCart record, @Param("example") ShoppingCartExample example);

    int updateByPrimaryKeySelective(ShoppingCart record);

    int updateByPrimaryKey(ShoppingCart record);

    List<ShoppingCartForm> selcetCartByUserId(Integer userId);

    int updateNumber(@Param("userId") Integer userId, @Param("productId") Integer productId, @Param("quantity") Integer quantity);

    int updateQuantity(@Param("userId") Integer userId, @Param("productId") Integer productId, @Param("quantity") Integer quantity);

    int checkallByUserId(Integer userId);

    int cancelCheckall(Integer userId);

    int checkedNum(Integer userId, Integer carId);

    int checkedSum(Integer userId);

    int CheckOne(Integer userId, Integer productId);

    int cancelCheck(Integer userId, Integer productId);

    ShoppingCart selectById(Integer userId, Integer productId);


}